package com.cskaoyan.servlet;

import com.cskaoyan.bean.MarketRegion;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.vo.RegionVo;
import com.cskaoyan.service.AdminRegionService;
import com.cskaoyan.service.AdminRegionServiceimpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author Ramsey
 * @date 2023年05月28日 21:51
 */
@WebServlet("/admin/region/*")
public class AdminRegionServlet extends WdBaseServlet {

    AdminRegionService regionService = new AdminRegionServiceimpl();
    public BaseRespVo list(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("单表当三表符合查询");
        List<RegionVo> marketRegions = regionService.selectAll();
        for (RegionVo marketRegion : marketRegions) {
            System.out.println(marketRegion);
        }
        CommonData Data = CommonData.data(marketRegions);
        return BaseRespVo.ok(Data);
    }
}
